<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:include="teacher/common :: commonhead">
    <!--<div th:replace="teacher/common :: commonhead"></div>-->
</head>
<head>
    <title>展示作业列表</title>
    <!--这里写这个页面单独需要的css-->
</head>
<body class="sticky-header">

<section>
    <!--  引入左侧边  -->
    <div th:replace="teacher/common :: left"></div>

    <div class="main-content">
        <div th:replace="teacher/common :: header-section"></div>
        <!--这里开始写东西-->
        <section class="panel">
            <header class="panel-heading">
                已完成
            </header>
            <div class="container">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>学号</th>
                        <th>姓名</th>
                        <th>分数</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                        <tr th:each="homework : ${homeworks.getRecords}">
                            <th th:text="${homework.student.stuId}"></th>
                            <th th:text="${homework.student.stuName}"></th>
                            <th th:if="${homework.hwsMark == null}">未批阅</th>
                            <th th:if="${homework.hwsMark != null}" th:text="${homework.hwsMark} + ' / ' + ${homework.homework.hwFullMark}"></th>
                            <th>
                                <a class="btn btn-info" th:href="@{/teacher/checkHomework(hwId=${homework.hwId}, stuId=${homework.stuId})}">批改</a>
                            </th>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="row">
                <div class="col-lg-4">
                    <div class="dataTables_info" id="editable-sample_info"></div>
                </div>
                <div class="col-lg-6">
                    <div class="dataTables_paginate paging_bootstrap pagination">
                        <ul>
                            <li class="prev">
                                <a th:href="@{/teacher/homeworkList/(hwId=${hwId},nowPage=${homeworks.current - 1 < 1 ? 1 : homeworks.current - 1})}">← 上一页</a>
                            </li>
                            <li th:class="${num == homeworks.current ? 'active' : ''}" th:each="num : ${#numbers.sequence(1, homeworks.pages)}">
                                <a th:href="@{/teacher/homeworkList/(hwId=${hwId},nowPage=${num})}" th:text="${num}"></a>
                            </li>
                            <li class="next">
                                <a th:href="@{/teacher/homeworkList/(hwId=${hwId},nowPage=${homeworks.current + 1 > homeworks.pages ? homeworks.pages : homeworks.current + 1})}">下一页 → </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <section class="panel">
            <header class="panel-heading">
                未完成
            </header>
            <div class="container">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>学号</th>
                        <th>姓名</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="stu : ${stuNotFinished}">
                        <th th:text="${stu.stuId}"></th>
                        <th th:text="${stu.stuName}"></th>
                    </tr>
                    </tbody>
                </table>
            </div>
        </section>

    </div>
</section>

<div th:replace="teacher/common :: commonjs"></div>

</body>
</html>